﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Babylon.js Template</title>

    <style>
        html, body {
            overflow: hidden;
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
        }

        #renderCanvas {
            width: 100%;
            height: 100%;
            touch-action: none;
        }
    </style>

</head>
<body>

    <canvas id="renderCanvas"></canvas>

    <!-- LIBS -->
    <script src="libs/babylon.max.js" type="text/javascript"></script>
    <script src="libs/babylon.editor.extensions.js" type="text/javascript"></script>

    <!-- OTHER JS FILES -->
EXPORTER-JS-FILES-TO-ADD

    <!-- GAME -->
    <script src="libs/game.js" type="text/javascript"></script>

    <script type="text/javascript">
        var canvas = document.getElementById("renderCanvas");
        var engine = new BABYLON.Engine(canvas);

        BABYLON.SceneLoader.Load("./Scene/", "EXPORTER-SCENE-NAME", engine, function (scene) {
            if (!scene.activeCamera) {
                var camera = new BABYLON.FreeCamera("Default Camera", new BABYLON.Vector3(15, 15, 15), scene);
                camera.setTarget(BABYLON.Vector3.Zero());
            }

            scene.activeCamera.attachControl(canvas);

            BABYLON.EDITOR.EXTENSIONS.EditorExtension.LoadExtensionsFile("./Scene/extensions.editorextensions", function (data) {
                BABYLON.EDITOR.EXTENSIONS.EditorExtension.ApplyExtensions(scene);

                scene.executeWhenReady(function () {
                    engine.runRenderLoop(function () {
                        scene.render();
                    });

                    window.onresize = function () {
                        engine.resize();
                    }
                });
            });
        });
    </script>

</body>
</html>
